package com.cnap.multiclouldmgmt.model.microSvc;

import com.cnap.multiclouldmgmt.model.enums.MsgTypeEnum;
import com.cnap.multiclouldmgmt.model.microSvc.alg.IndexValueModel;
import com.cnap.multiclouldmgmt.model.microSvc.assist.MsgInfoAssist;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

import java.util.List;

@ApiModel(value = "com.cnap.multiclouldmgmt.model.microSvc.MsgInfo",description = "消息中心的消息")
public class MsgInfo {


    @ApiModelProperty(value = "id")
    private int id;

    @ApiModelProperty(value = "msgType：调度优化更新，资源告警")
    private String msgType;

    @ApiModelProperty(value = "具体消息的内容")
    private List<MsgInfoAssist> msgInfos;

    @ApiModelProperty(value = "具体消息的内容")
    private String msgUrl;

    /**
     * get
     *
     * @return MsgUrl
     */
    public String getMsgUrl() {

        if (StringUtils.isEmpty(msgUrl)){

            msgUrl = MsgTypeEnum.getMsgUrlEnumByMsgType(msgType);
        }

        return msgUrl;
    }

    /**
     * set
     *
     * @param msgUrl msgUrl
     */
    public void setMsgUrl(String msgUrl) {
        this.msgUrl = msgUrl;
    }

    /**
     * get
     *
     * @return Id
     */
    public int getId() {
        return id;
    }

    /**
     * set
     *
     * @param id id
     */
    public void setId(int id) {
        this.id = id;
    }

    /**
     * get
     *
     * @return MsgType
     */
    public String getMsgType() {
        return msgType;
    }

    /**
     * set
     *
     * @param msgType msgType
     */
    public void setMsgType(String msgType) {
        this.msgType = msgType;
    }

    /**
     * get
     *
     * @return MsgInfos
     */
    public List<MsgInfoAssist> getMsgInfos() {
        return msgInfos;
    }

    /**
     * set
     *
     * @param msgInfos msgInfos
     */
    public void setMsgInfos(List<MsgInfoAssist> msgInfos) {
        this.msgInfos = msgInfos;
    }
}
